package com.czk.netty.netty.inboundandoutboundhandler.client;

import io.netty.bootstrap.Bootstrap;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/1/20 22:38
 */
public class MyClient {
    public static void main(String[] args) {
        EventLoopGroup group = new NioEventLoopGroup();
        try {
            Bootstrap bootstrap = new Bootstrap();
            bootstrap.group(group)
                    .channel(NioSocketChannel.class)
                    // 自定义初始化对象
                    .handler(new MyClientInitializer());
            bootstrap.connect("127.0.0.1", 7000).sync();
        } catch (Exception ex) {

        }
    }
}
